package org.slf4j.impl;

import org.slf4j.ILoggerFactory; 
import java.util.HashMap;
import java.util.Map;

/**
 * Clase necesaria para la construccion e inicializacion 
 * de nuestra libreria de Log en SLF4J.
 */
public class TpTecniLoggerFactory implements ILoggerFactory{
    
	private Map<String, TpTecniLoggerAdapter> loggerMap;
	
	public TpTecniLoggerFactory() {
	        loggerMap = new HashMap<String, TpTecniLoggerAdapter>();
	}
	
	@Override
	public TpTecniLoggerAdapter getLogger(String name) {
		synchronized (loggerMap) {
            if (!loggerMap.containsKey(name)) {
                loggerMap.put(name, new TpTecniLoggerAdapter(name));
            }
            return loggerMap.get(name);
		}
	}

}
